<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var nian = prompt("请输入一个年份让我来判断是闰年还是平年？")
        nian = +nian;
        if (nian) {
            if (nian % 4 == 0 && nian % 100 != 0 || nian%400 ==0) {
                alert("您输入的年份为闰年!");
            } else {
                alert("您输入的年份为平年!");
            }
        }else{
            alert("请输入正确格式!!");
            location.reload();
        }
        var year= confirm("请选择是否继续操作!!");
        if(year){
            location.reload();
        }
    </script>
</body>

</html>